package com.derek.omshopping.ui.home.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by duyb on 2016-10-17.
 * Desc:首页tab切换fragment
 */

public class FragmentMainTabAdapter extends FragmentPagerAdapter {
    private List<Fragment> list;

    public FragmentMainTabAdapter(FragmentManager fm, List<Fragment> list) {
        super(fm);
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }
}
